<?php

/*
  VoIP Wholesale 1.0
  ------------------
  Document   : module_origin_add
  Created on : Sep 14, 2011, 4:32:27 PM
  Author     : Milos Jovanovic <miloscode@gmail.com>
  Description:

 */
?>
<div id="page-title"><?=lang('term_termination_trunks')?></div>

<div id="page-desc"><?=lang('text_termination_trunks_desc')?></div>

<div class="ui-widget"> 
    <div id="content">
        <div class="module-options">
            <button id="module-add-termination-trunk"><?=lang('button_add_new_termination_trunk')?></button>
        </div>
        
        <fieldset>
        <!-- PAGE CONTENT -->
	<form action="" method="post" id="new-trunk" onsubmit="return false;"> 
		<fieldset class="ui-widget-content ui-corner-all">
		<legend class="ui-widget-content ui-corner-all"><?=lang('text_trunk_information')?></legend>
				<p>
					<label><?=lang('term_carrier')?></label> 
					<?=$this->APPLICATION->app_carriers->generate_menu('we_buy_from_them',"data[carrier_id]","","carrier")?>
                </p>
				<p>
					<label><?=lang('term_short_name')?></label> 
					<input type="text" name="data[short_name]" id="short_name" class="ui-state-disabled text ui-widget-content ui-corner-all" /> 
					<div id="short_name_status"></div>
                </p>
				<p class="cli"> 
					<span class="I">
							<input type="radio" name="data[cli_guaranteed]" value="1"/>
					</span>
					<span class="II">
							<label><?=lang('term_cli_guaranteed')?></label>
					</span>
					<span class="III">
							<input type="radio" name="data[cli_guaranteed]" value="0"/>
					</span>
					<span class="IV">
							<label><?=lang('term_cli_not_guaranteed')?></label>
					</span>
				</p>				
				<p>
					<label><?=lang('term_description')?></label> 
					<textarea name="data[description]" class="ui-widget-content module-textarea"></textarea>
				</p>
			</fieldset>
		<fieldset class="ui-widget-content ui-corner-all">
		<legend class="ui-widget-content ui-corner-all"><?=lang('text_codecs')?></legend>			
				<p>
					<div class="codecs">
						<?=$this->APPLICATION->app_codecs->generate_menu("codecs","","module-codec")?>
					</div>
                </p>	
		</fieldset>
		<fieldset class="ui-widget-content ui-corner-all">
		<legend class="ui-widget-content ui-corner-all"><?=lang('text_access_parameters')?></legend>			
				<p>
					<div class="access">
								<span class="ip_address">
								<?=lang('term_ip_address')?>
								</span>
								<span class="tech_prefix">
								<?=lang('term_tech_prefix')?>
								</span>								
								<br />
								
						<div class="rows-container">
						<script type="text/javascript">
							var row_number = 0;
						</script>
							<div class="row ui-state-default ui-corner-all" id="row_0">
								<input type="hidden" name="data[parameters][]" value="0"/>
								<input type="text" name="data[ip_address_segment_1][]" class="address text ui-widget-content ui-corner-all" maxlength="3"/> . 
								<input type="text" name="data[ip_address_segment_2][]" class="address text ui-widget-content ui-corner-all"  maxlength="3"/> . 
								<input type="text" name="data[ip_address_segment_3][]" class="address text ui-widget-content ui-corner-all"  maxlength="3"/> . 
								<input type="text" name="data[ip_address_segment_4][]" class="address text ui-widget-content ui-corner-all"  maxlength="3"/>
								<input type="text" name="data[tech_prefixes][]" class="prefix_field text ui-widget-content ui-corner-all"/>							
								<a href="javascript:void(0);" onclick="delete_row(this);" class="button ui-state-default ui-corner-all" title="<?=lang('term_delete')?>"><span class="ui-icon ui-icon-circle-close"></span><?=lang('term_delete')?></a>
							</div>
							
						</div>
								
								<br />
								<a href="javascript:void(0);" onclick="add_new_row(this);" class="button ui-state-default ui-corner-all" title="<?=lang('term_add_new_row')?>"><span class="ui-icon ui-icon-circle-close"></span><text><?=lang('term_add_new_row')?></text></a>
					</div>
                </p>	
		</fieldset>		
				<p>
					<input type="hidden" name="data[confirm]" id="confirm" value="false"/>
					<div id="response"></div><br />
					<button id="module-save-termination-trunk"><?=lang('button_save')?></button>
				</p>
	 </form> 

	 </div>    
</div>   

						<p class="sample-row">
								<a href="javascript:void(0);" onclick="delete_row(this);" class="button delete ui-state-default ui-corner-all" title="<?=lang('term_delete')?>"><span class="ui-icon ui-icon-circle-close"></span><?=lang('term_delete')?></a>
						</p>						
